Ext.define('Html5App.view.customer.CustomerNewOrder', {
	alternateClassName : 'customerNewOrder',
	extend : 'Ext.Container',
	xtype : 'customerNewOrder',
	id : 'customerNewOrder',
	requires : ['Html5App.view.customer.NewOrderSelectBrand'],
	config : {
		height : '100%',
		items : [{
			xtype : 'container',
			cls : 'customer-new-order-label',
			layout : {
				type : 'hbox'
			},
			items : [{
				flex : 5,
				cls : 'customer-new-order-padding customer-new-order-name',
				id : 'customer-new-order-customer-name',
				html : ''
			},{
				flex : 1,
				xtype : 'panel',
				cls : 'customer-new-order-padding',
				html : '新訂單'
			}]
		},{
			xtype : 'container',
			cls : 'customer-new-order-info',
			layout : {
				type : 'hbox'
			},
			items : [{
				flex : 3,
				xtype : 'container',
				items : [{
					xtype : 'container',
					layout : {
						type : 'hbox'
					},
					items : [{
						flex : 1,
						cls : 'customer-new-order-info-left',
						html : '訂單日期：'
					},{
						flex : 1.,
						cls : 'customer-new-order-info-right',
						id : 'order-date',
						html : ''
					},{
						flex : 1,
						cls : 'customer-new-order-info-left',
						html : '付款方式：'
					},{
						flex : 0.7,
						cls : 'customer-new-order-info-right',
						id : 'payment-mode',
						html : ''
					}]
				},{
					xtype : 'container',
					layout : {
						type : 'hbox'
					},
					items : [{
						flex : 1,
						cls : 'customer-new-order-info-left',
						html : '送貨日期：'
					},{
						flex : 1,
						cls : 'customer-new-order-info-right',
						id : 'delivery-date',
						html : ''
					},{
						flex : 1,
						cls : 'customer-new-order-info-left',
						html : '貨款餘額：'
					},{
						flex : 0.7,
						cls : 'customer-new-order-info-right',
						id : 'balance',
						html : '$0.00'
					}]
				}]
			},{
				flex : 0.8,
				xtype : 'container',
				items : [{
					xtype : 'button',
					cls : 'customer-new-order-select-commodity-button',
					action : 'selectBrand',
					html : '選擇貨品'
				}]
			}]
		},{
			xtype : 'container',
			layout : {
				type : 'hbox'
			},
			cls : 'customer-new-order-info',
			style : 'border-bottom: 1px solid #CFCFCF;',
			items : [{
				flex : 1.356,
				cls : 'customer-new-order-info-left',
				html : '送貨地址：'
			},{
				flex : 5,
				cls : 'customer-new-order-info-right',
				style : 'overflow: hidden;',
				id : 'delivery-address',
				html : ''
			}]
		},{
			html : '<table width="100%" border="0" cellpadding="0" cellspacing="0" style="background-color:#FFFFFF;border-bottom:1px solid #CFCFCF;font-size:0.7rem;color:#4C4C4C;">'+
					  '<tr style="height:2rem;text-align:center;">'+
					    '<td style="border-bottom:1px solid #CFCFCF;border-right:1px solid #CFCFCF;width:16%;">貨品編號</td>'+
					    '<td style="border-bottom:1px solid #CFCFCF;border-right:1px solid #CFCFCF;width:30%;">貨品名稱</td>'+
					    '<td style="border-bottom:1px solid #CFCFCF;border-right:1px solid #CFCFCF;width:8%;">單位</td>'+
					    '<td style="border-bottom:1px solid #CFCFCF;border-right:1px solid #CFCFCF;width:12%;">數量</td>'+
					    '<td style="border-bottom:1px solid #CFCFCF;border-right:1px solid #CFCFCF;width:10%;">單價</td>'+
					    '<td style="border-bottom:1px solid #CFCFCF;border-right:1px solid #CFCFCF;width:17%;">項計</td>'+
					    '<td style="border-bottom:1px solid #CFCFCF;width:6%;">&nbsp;</td>'+
					  '</tr>'+
					'</table>'
		},{
			xtype : 'container',
			cls : 'customer-new-order-container',
			scrollable : 'vertical',
			height : '100%',
			items : [{
				id : 'orderItemData',
				html : '<table id="orderItem" width="100%" border="0" cellpadding="0" cellspacing="0" style="margin:-1px 0px;background-color:#FFFFFF;border-top:1px solid #CFCFCF;border-bottom:1px solid #CFCFCF;font-size:0.7rem;color:#4C4C4C;">'+
						  '<tr id="item0" style="height:2rem;background-color:#F5F5F5;">'+
						    '<td style="border-right:1px solid #CFCFCF;padding:0.1rem 0.1rem;width:16%;">' +
						    	'<input style="border-radius:3px;text-align:center;border:1px solid #888888;height:1.6rem;width:2.8rem;" onkeyup="javascript:custom.onkeyupNumber(\'itemId0\')" onblur="javascript:custom.onchangeItemCode(\'itemId0\')" type="text" id="itemId0" name="itemId" value="" />' +
						    '</td>'+
						    '<td style="border-right:1px solid #CFCFCF;padding-left:0.1rem;width:30%;">&nbsp;</td>'+
						    '<td style="border-right:1px solid #CFCFCF;padding-left:0.1rem;width:8%;">&nbsp;</td>'+
						    '<td style="border-right:1px solid #CFCFCF;padding:0.1rem 0.1rem;width:12%;text-align:center;">' +
						    	'<input style="border-radius:3px;text-align:center;border:1px solid #888888;height:1.6rem;width:2rem;" onkeyup="javascript:custom.onkeyupOrderNumber(\'itemNum0\')" onblur="javascript:custom.onkeyupOrderNumber(\'itemNum0\')" type="text" id="itemNum0" name="itemNum" value="" />' +
						    '</td>'+
						    '<td style="border-right:1px solid #CFCFCF;padding-left:0.1rem;width:10%;">&nbsp;</td>'+
						    '<td style="border-right:1px solid #CFCFCF;padding-left:0.1rem;width:17%;">&nbsp;</td>'+
						    '<td style="text-align:center;width:6%;">&nbsp;</td>'+
						  '</tr>'+
						'</table>'
			},{
				xtype : 'container',
				docked : 'bottom',
				cls : 'customer-new-order-item customer-new-order-item-docked',
				items : [{
					xtype : 'container',
					layout : {
						type : 'hbox'
					},
					items : [{
						flex : 1,
						cls : 'customer-new-order-info-left',
						html : '全單總計：'
					},{
						flex : 2,
						cls : 'customer-new-order-info-right',
						id : 'orderTotal',
						html : '$0.00'
					},{
						flex : 1,
						xtype : 'container',
						items : [{
							xtype : 'button',
							cls : 'customer-new-order-settle-button',
							action : 'orderSettleAction',
							html : '結算'
						}]
					}]
				}]
			}]
		}]
	}
});